/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package EntityBeans;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Keith Augustsson
 */
@Embeddable
public class SeatinstancesPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "nr")
    private int nr;
    @Basic(optional = false)
    @Column(name = "sRow")
    private char sRow;
    @Basic(optional = false)
    @Column(name = "flight")
    private String flight;

    public SeatinstancesPK(int nr, char sRow, String flight) {
        this.nr = nr;
        this.sRow = sRow;
        this.flight = flight;
    }

    public int getNr() {
        return nr;
    }

    public void setNr(int nr) {
        this.nr = nr;
    }

    public char getSRow() {
        return sRow;
    }

    public void setSRow(char sRow) {
        this.sRow = sRow;
    }

    public String getFlight() {
        return flight;
    }

    public void setFlight(String flight) {
        this.flight = flight;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) nr;
        hash += (int) sRow;
        hash += (flight != null ? flight.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof SeatinstancesPK)) {
            return false;
        }
        SeatinstancesPK other = (SeatinstancesPK) object;
        if (this.nr != other.nr) {
            return false;
        }
        if (this.sRow != other.sRow) {
            return false;
        }
        if ((this.flight == null && other.flight != null) || (this.flight != null && !this.flight.equals(other.flight))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "EntityBeans.SeatinstancesPK[nr=" + nr + ", sRow=" + sRow + ", flight=" + flight + "]";
    }

}
